package Alex;

import org.testng.annotations.*;

import static org.junit.Assert.*;
import Alex.model.Search;

public class FindMovie extends Alex.pages.TestBase {
	
	@BeforeMethod
	public void login(){
		if (app.getUserHelper().isNotLoggedIn()){
			app.getUserHelper().loginAsAdmin();
		}
	}
	
	@AfterMethod
	public void clearFilter(){
		app.getSearchHelper().clearFilter();
	}
	
	@Test
	  public void testMovieIsNotFound() throws Exception {
	
		Search search = new Search().setFilter("test373737");
		app.getSearchHelper().filterIs(search);
		assertTrue(app.getSearchHelper().movieIsNotFound());
		}
	
	@Test
	  public void testMovieIsFound() throws Exception {
		
		Search search = new Search().setFilter("Alex");
		app.getSearchHelper().filterIs(search);
		assertTrue(app.getSearchHelper().movieIsFound());
		}
	

	
}